package com.kkb.test;

import com.kkb.pojo.User;
import com.kkb.service.UserService;
import com.kkb.vo.UserQueryVo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Lxy
 * @create 2022-03-18 13:48
 */

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring.xml"})
public class testUser {
    @Resource
    private UserService userService;
    @Test
    public void test(){
        UserQueryVo vo = new UserQueryVo();
        vo.setUsername("lxy");
        vo.setPassword("197120");
        List<User> userList = userService.getUser(vo);
        for (User user : userList) {
            System.out.println(user);
        }
    }


    @Test
    public void testPass(){
        User user = new User();
        user.setU_loginName("lxy");
        user.setU_passWord("197120");
        int i = userService.updatePass("123456", user);
        System.out.println(i);
    }

}
